package com.lengxf.aPlugins.entity;

import com.lengxf.aPlugins.bizType.BizEnums;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "EVENT_POINT_QUEUE_CONFIG")
public class EventPointQueueConfigEntity  implements SqlGenerator{

    /**
     * ID
     */
    @Schema(description = "ID")
    private Long id;

    /**
     * QUEUE_NAME
     */
    @Schema(description = "QUEUE_NAME")
    private String queueName;

    /**
     * BUSINESS_TYPE_ID
     */
    @Schema(description = "BUSINESS_TYPE_ID")
    private Long businessTypeId;

    /**
     * CREATION_TIME
     */
    @Schema(description = "CREATION_TIME")
    private LocalDateTime creationTime;

    /**
     * CREATION_USER
     */
    @Schema(description = "CREATION_USER")
    private String creationUser;

    /**
     * LAST_MODIFIED_TIME
     */
    @Schema(description = "LAST_MODIFIED_TIME")
    private LocalDateTime lastModifiedTime;

    /**
     * LAST_MODIFIED_USER
     */
    @Schema(description = "LAST_MODIFIED_USER")
    private String lastModifiedUser;

    /**
     * ENABLE
     */
    @Schema(description = "ENABLE")
    private Integer enable;

    public EventPointQueueConfigEntity(Long bizId, String areaEn, BizEnums bizEnums) {
        this.id = bizId;
        this.businessTypeId = bizId;
        this.enable = 1;
        this.queueName = areaEn.toLowerCase() + "." + bizEnums.getListenerName().toLowerCase() + "." + "queue";
        this.creationTime = LocalDateTime.now();
        this.lastModifiedTime = LocalDateTime.now();
        this.creationUser = "admin";
        this.lastModifiedUser = "admin";
    }

}
